<template>
  <div class="sort">
    <div class="text">
        <h3>猜你喜欢</h3>
    </div>
    <div class="paisu">
        <span  :class="{active:dainIndex ==index}" v-for="(item,index) in arr" :key="index" @click="$emit('deliverIndex',index)">{{item}}</span>
    </div>
    <div class="remai">
        <span v-for="(item,index) in arr1" :key="index">{{item}}</span>
    </div>
  </div>
</template>

<script>
export default {
    data(){
        return {
            arr:['综合排序','距离最近','销量最高','筛选'],
            arr1:['年货节热卖','津贴联盟','满减优惠','配置联盟'],
        }
    },
    props:{
        dainIndex:{type:Number}
    },
   
}
</script>

<style lang="scss" scoped>
.sort{
    padding: 0 10px;
}

.sort .paisu {
    display: flex;
    justify-content: space-around;
    margin: 10px 0;
}

.sort .paisu span{
    display: inline-block;
}

.sort .remai {
    display: flex;
    justify-content: space-around;
    margin: 10px 0;
}

.sort .remai span{
    font-size: 14px;
    display: inline-block;
    background-color: #f5f5f5;
    padding: 5px;
}

.sort .paisu span.active{
    font-weight: bold;
}

</style>